package org.skyfree.ghyll.tcard.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class FileUtil 
{
	private static int bufferSize = 4 * 1024;
	
	public static void copyFile(File srcFile, File destFile) throws IOException 
	{
		InputStream in = new FileInputStream(srcFile);
		OutputStream out = new FileOutputStream(destFile);
		byte[] buffer = new byte[bufferSize];
		int bytesRead;
		while ((bytesRead = in.read(buffer)) >= 0) {
			out.write(buffer, 0, bytesRead);
		}
		out.close();
		in.close();
	}
}
